import book.BookList;
import user.AdminUser;
import user.NormalUsers;
import user.User;

import java.util.Scanner;

public class TextBook {
    public static User login(){
        System.out.println("请输入你的姓名：");
        Scanner sc = new Scanner(System.in);
        String name = sc.nextLine();
        System.out.println("请输入你的身份：1. 管理员 0. 读者");
        int choice = sc.nextInt();
        if(choice == 1){
            return new AdminUser(name);
        }else{
            return new NormalUsers(name);
        }
    }
    public static void main(String[] args) {
        User user = login();
        BookList bookList = new BookList();

        while(true){
            int choice = user.menu();//返回的是具体哪项操作
            user.dowork(choice,bookList);
        }

    }
}
